-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Fix @return
annotation for CompositeUrlRule::createRules()
#20585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix @return
annotation for CompositeUrlRule::createRules()
#20585
Conversation
mspirkov
commented
Oct 8, 2025
Q | A |
---|---|
Is bugfix? | ✔️ |
New feature? | ❌ |
Breaks BC? | ❌ |
Fixed issues |
/** | ||
* Creates the URL rules that should be contained within this composite rule. | ||
* @return UrlRuleInterface[] the URL rules | ||
* @return UrlRuleInterface[]|UrlRuleInterface[][] the URL rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
/** | ||
* Creates the URL rules that should be contained within this composite rule. | ||
* @return UrlRuleInterface[] the URL rules | ||
* @return UrlRuleInterface[]|UrlRuleInterface[][] the URL rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is in the structure with additional array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an array of the form array<string, UrlRuleInterface[]>
. It contains several sets of rules grouped by URL name.
yii2/framework/rest/UrlRule.php
Line 179 in 9093960
$rules[$urlName][] = $this->createRule($pattern, $prefix, $controller . '/' . $action); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is always like that or UrlRuleInterface[]
is valid as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UrlRuleInterface[]
is valid as well
yii2/framework/web/GroupUrlRule.php
Lines 109 to 116 in 9093960
$rule = Yii::createObject(array_merge($this->ruleConfig, $rule)); | |
if (!$rule instanceof UrlRuleInterface) { | |
throw new InvalidConfigException('URL rule class must implement UrlRuleInterface.'); | |
} | |
$rules[] = $rule; | |
} | |
return $rules; |
Thank you! |
1 similar comment
Thank you! |